<div id="package-queue" style="height: 100%">

</div>
<script type="text/javascript">
    $(function () {
        $.ajax({
            url: "#springUrl('/simulation/queue')",
            data: {"batchId": "$!{batchId}", "index": "20"},
            type: "POST",
            success: function (text) {
                var d = JSON.parse(text);
                if (d.success && d.data) {
                    var myChart = echarts.init(document.getElementById('package-queue'), 'macarons');
                    var option = {
                        tooltip: {
                            trigger: 'axis',
                            position: function (pt) {
                                return [pt[0], '10%'];
                            }
                        },
                        title: {
                            left: 'center',
                            text: '包装服务台过程模拟'
                            ,show:false
                        },
                        grid: {
                            left: '3%',
                            right: '8%',
                            bottom: '15%',
                            top:'18%',
                            containLabel: true
                        },
                        toolbox: {

                        },
                        xAxis: {
                            type: 'category',
                            data: d.data.date,
                            axisLabel:{
                                show:true,
                                textStyle:{
                                    color:"#595959"
                                }
                            },
                            axisLine: {
                                show: false
                            },
                            axisTick: {
                                show: false
                            },
                        },
                        yAxis: {
                            type: 'value',
                            axisLine: {
                                show: false
                            },
                            axisTick: {
                                show: false
                            },
                            axisLabel: {
                                formatter: function(value){
                                    var var1=value*1;
                                    return var1;
                                },
                                textStyle:{
                                    color:"#595959"
                                }
                            },
                            splitLine:{
                                show:true
                            },
                            splitArea: {
                                show:true,
                                areaStyle: {
                                    color: ['rgba(0,0,0,0)', 'rgba(0,0,0,0)']
                                }
                            },
                        },
                        dataZoom: [{
                            type: 'inside',
                            start: 0,
                            end: 10
                        }, {
                            start: 0,
                            end: 10,
                            handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
                            handleSize: '80%',
                            handleStyle: {
                                color: '#fff',
                                shadowBlur: 3,
                                shadowColor: 'rgba(0, 0, 0, 0.6)',
                                shadowOffsetX: 2,
                                shadowOffsetY: 2
                            }
                        }],
                        series: [
                            {
                                name: '等待队列',
                                type: 'line',
                                smooth: true,
                                symbol: 'none',
                                sampling: 'average',
                                itemStyle: {
                                    normal: {
                                        color: "#4472c4"
                                    }
                                },
                                areaStyle: {
                                    normal: {
                                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                            offset: 0,
                                            color: "#6adbff"
                                        }, {
                                            offset: 1,
                                            color: "#08a1fe"
                                        }])
                                    }
                                },
                                data: d.data.data
                            }
                        ]
                    };
                    option.series[0].markPoint = {
                        data: [
                            {type: 'max', name: '最大值'}
                        ]
                    };
                    myChart.setOption(option);
                }
            }
        });
    });

</script>